package com.william.jdbcplus.core.condition.segment.impl;

import com.william.jdbcplus.core.toolkit.StringPool;

import java.util.stream.Collectors;

/**
 * 联合查询
 *
 * @author niliwei
 */
public class UnionSegmentList extends AbstractSegmentList {

    @Override
    public String getSegment() {
        if (isEmpty()) {
            return StringPool.EMPTY;
        }
        return StringPool.SPACE + this.stream().collect(Collectors.joining(StringPool.SPACE));
    }

    @Override
    public String getSql() {
        if (isEmpty()) {
            return StringPool.EMPTY;
        }

        return StringPool.SPACE + this.stream().collect(Collectors.joining(StringPool.SPACE));
    }
}